package com.blog.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.blog.entity.SysJob;
import org.quartz.SchedulerException;
import org.springframework.stereotype.Service;

/**
 * @author cgx
 * @Date 2022/1/6 10:07
 */
@Service
public interface SysJobService extends IService<SysJob> {

    /**
     * 改变任务状态
     * @param sysJob
     * @return
     */
    int changeStatus(SysJob sysJob) throws SchedulerException;

    /**
     * 新增任务
     * @param job
     * @return
     */
    boolean saveJob(SysJob job) throws Exception;

    /**
     * 恢复任务
     * @param job 调度信息
     * @return 结果
     */
     int resumeJob(SysJob job) throws SchedulerException;

    /**
     * 暂停任务
     * @param job 调度信息
     * @return 结果
     */
    public int pauseJob(SysJob job) throws SchedulerException;
}
